import request from '@/common/utils/request'
import { setPageParams } from '@/common/utils/common'


export  function fetchOptions(param) {
  return request({
    url: '/platform-api/column/select-option',
    method: 'get',
    params: param
  })
}

export  function fetchTreeGridData(param) {
  param = setPageParams(param)
  param.type = "draw";
  return request({
    url: '/platform-api/column/getTreeGridData',
    method: 'get',
    params: param
  })
}

export  function fetchList(param) {
  param = setPageParams(param)
  return request({
    url: '/platform-api/column/list',
    method: 'get',
    params: param
  })
}

export function createColumn(data) {
  return request({
    url: '/platform-api/column/add',
    method: 'post',
    data
  })
}

export function updateColumn(data) {
  return request({
    url: '/platform-api/column/update',
    method: 'post',
    data
  })
}
export function delColumn(data) {
  return request({
    url: '/platform-api/column/delete',
    method: 'post',
    data
  })
}

export function getColumn(id) {
  return request({
    url: '/platform-api/column/get?id='+id,
    method: 'get'
  })
}
